package com.cyt.work.wb.model.po;

import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 维保模块-设备表实体类
 *
 * @author shengQiang Yu
 * @date 2019-11-28 9:26:43
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_wb_devices")
public class WbDevices implements Serializable {

	/**
     * 主键
     */ 
	@Id
	private String id;

	/**
     * 应用id
     */ 
	@Column(name = "apply_id")
	private String applyId;

	/**
     * 设备名称
     */ 
	@Column(name = "name")
	private String name;

	/**
     * 设备编号
     */ 
	@Column(name = "num")
	private String num;

	/**
     * 设备分类
     */ 
	@Column(name = "device_type_id")
	private String deviceTypeId;

	/**
     * 设备类别
     */ 
	@Column(name = "device_category")
	private String deviceCategory;

	/**
     * 设备型号
     */ 
	@Column(name = "device_model")
	private String deviceModel;

	/**
     * 存放地点
     */ 
	@Column(name = "room_id")
	private String roomId;

	/**
     * 生产日期
     */ 
	@Column(name = "produced_date")
	private Date producedDate;

	/**
     * 购买日期
     */ 
	@Column(name = "buy_date")
	private Date buyDate;

	/**
     * 维修日期
     */ 
	@Column(name = "maintenance_date")
	private Date maintenanceDate;

	/**
     * 使用年限
     */ 
	@Column(name = "durable_time")
	private String durableTime;

	/**
     * 供应商ID
     */ 
	@Column(name = "servicer_id")
	private String servicerId;

	/**
     * 合同ID
     */ 
	@Column(name = "contract_id")
	private String contractId;

	/**
     * 二维码
     */ 
	@Column(name = "two_dimension")
	private String twoDimension;

	/**
     * 备注信息
     */ 
	@Column(name = "remarks")
	private String remarks;

	/**
     * 排序
     */ 
	@Column(name = "sort")
	private Integer sort;

	/**
     * 删除标识
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;


	@Transient
	private String deviceTypeName;


	/**
	 * 服务商名称
	 */
	@Transient
	private String servicerName;

	/**
	 * 服务商负责人
	 */
	@Transient
	private String servicerPrincipal;

	/**
	 * 服务商手机号
	 */
	@Transient
	private String servicerMobile;

	/**
	 * 存放地点
	 */
	@Transient
	private String roomName;

	@Transient
	private String contractName;

	/**
	 * 创建对象
	 *
	 * @param sysUser 当前用户信息
	 * @author shengQiang Yu
	 * @date 2019-11-28 9:26:43
	 */
	public WbDevices(SysUser sysUser) {
		this.id = BaseUtil.uId();
		this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}